# -*- coding:utf-8 -*-

# @Time: 2025/3/23 21:15

# @Author: zhangbo

# @File: report_add_img.py

# @version: v1.0
from time import sleep
import allure

def add_img_report(driver, step_name, nees_sleep=False):
    """
    截图插入allure报告
    :param driver:
    :param step_name:
    :param nees_sleep:
    :return:
    """

    if nees_sleep:
        sleep(3)
    else:
        allure.attach(driver.get_screenshot_as_png(), step_name + ".png", allure.attachment_type.PNG)

